Object extraction from video images system and method

ABSTRACT

A computer implemented method of object extraction from video images, the method comprising steps a computer is programmed to perform, the steps comprising: receiving a plurality of video images, deriving a plurality of background templates from at least one of the received video images, calculating a plurality of differences from an individual one of the received video images, each one of the differences being calculated between the individual video image and a respective and different one of the background templates, and extracting an object of interest from the individual video image, using a rule applied on the calculated differences.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/470,477, filed Mar. 27, 2017, which is a continuation of U.S. patentapplication Ser. No. 14/525,181, filed Oct. 27, 2014, now U.S. Pat. No.9,639,954, issued May 2, 2017, each of which is hereby incorporated inits entirety including all tables, figures, and claims.

FIELD AND BACKGROUND OF THE INVENTION

The present invention relates to image processing and, moreparticularly, but not exclusively to extracting objects of interest fromvideo images captured during a sport event.

In recent years, the use of image processing and computer vision hasbeen gaining more and more popularity in a variety of fields andindustries. Some known industrial applications of image processing andcomputer vision include, for example, security surveillance systems,operational management systems (say in a retail industry environment),tactical battlefield systems, etc.

The extraction of objects of interest from video images is an aspect ofvideo analysis.

One of the techniques widely used in the fields of image processing andcomputer vision is background subtraction.

Background subtraction is a technique in which an image's foreground isextracted for further processing, usually for recognition of objects ofinterest.

Generally, an image's foreground is made of regions of the image, whichare occupied by objects of interest (humans, cars, text, etc.). After astage of image preprocessing (which may include image noise removal,morphology based analysis, etc.), object localization may be required,which object localization may make use of background subtraction.

Background subtraction is widely used for detecting moving objects (saycars or pedestrians) in videos, from static cameras, the rationale beingone of detecting the moving objects from the difference between thecurrent frame and a reference background template, also referred to as“background image” or “background model”, which is made of staticobjects such as a building or a traffic light positioned at a roadintersection.

Objection extraction by background subtraction is often done if theimage in question is a part of a video stream. Background subtractionprovides important cues for numerous applications in computer vision,for example surveillance tracking or human poses estimation.

SUMMARY OF THE INVENTION

According to one aspect of the present invention there is provided acomputer implemented method of object extraction from video images, themethod comprising steps a computer is programmed to perform, the stepscomprising: receiving a plurality of video images, deriving a pluralityof background templates from at least one of the received video images,calculating a plurality of differences from an individual one of thereceived video images, each one of the differences being calculatedbetween the individual video image and a respective and different one ofthe background templates, and extracting an object of interest from theindividual video image, using a rule applied on the calculateddifferences.

According to a second aspect of the present invention there is providedan apparatus for object extraction from video images, the apparatuscomprising: a computer, a video image receiver, implemented on thecomputer, configured to receive a plurality of video images, abackground template deriver, in communication with the video imagereceiver, configured to derive a plurality of background templates fromat least one of the received video images, a difference calculator, incommunication with the background template deriver, configured tocalculate a plurality of differences from an individual one of thereceived video images, each one of the differences being calculatedbetween the individual video image and a respective and different one ofthe background templates, and an object extractor, in communication withthe difference calculator, configured to extract an object of interestfrom the individual video image, using a rule applied on the calculateddifferences.

According to a third aspect of the present invention there is provided anon-transitory computer readable medium storing computer executableinstructions for performing steps of object extraction from videoimages, the steps comprising: receiving a plurality of video image,deriving a plurality of background templates from at least one of thereceived video images, calculating a plurality of differences from anindividual one of the received video images, each one of the differencesbeing calculated between the individual video image and a respective anddifferent one of the background templates, and extracting an object ofinterest from the individual video image, using a rule applied on thecalculated differences.

Unless otherwise defined, all technical and scientific terms used hereinhave the same meaning as commonly understood by one of ordinary skill inthe art to which this invention belongs.

The materials, methods, and examples provided herein are illustrativeonly and not intended to be limiting. Implementation of the method andsystem of the present invention involves performing or completingcertain selected tasks or steps manually, automatically, or acombination thereof.

Moreover, according to actual instrumentation and equipment of preferredembodiments of the method and system of the present invention, severalselected steps could be implemented by hardware or by software on anyoperating system of any firmware or a combination thereof.

For example, as hardware, selected steps of the invention could beimplemented as a chip or a circuit. As software, selected steps of theinvention could be implemented as a plurality of software instructionsbeing executed by a computer using any suitable operating system. In anycase, selected steps of the method and system of the invention could bedescribed as being performed by a data processor, such as a computingplatform for executing a plurality of instructions.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention is herein described, by way of example only, withreference to the accompanying drawings. With specific reference now tothe drawings in detail, it is stressed that the particulars shown are byway of example and for purposes of illustrative discussion of thepreferred embodiments of the present invention only, and are presentedin order to provide what is believed to be the most useful and readilyunderstood description of the principles and conceptual aspects of theinvention. The description taken with the drawings making apparent tothose skilled in the art how the several forms of the invention may beembodied in practice.

In the drawings:

FIG. 1 is a block diagram schematically illustrating an exemplaryapparatus for object extraction from video images, according to anexemplary embodiment of the present invention.

FIG. 2 is a simplified flowchart schematically illustrating a firstexemplary method for object extraction from video images, according toan exemplary embodiment of the present invention.

FIG. 3 is a simplified flowchart schematically illustrating a secondexemplary method for object extraction from video images, according toan exemplary embodiment of the present invention.

FIGS. 4A-4H are simplified block diagrams schematically illustrating afirst implementation scenario, according to an exemplary embodiment ofthe present invention.

FIG. 4A illustrates a player who stands in a left position next to oneor more trees and a cloud.

FIG. 4B illustrates a player who stands in a right position next to oneor more trees and a cloud.

FIG. 4C is a background template containing one or more trees and acloud. It does not include the image of a player.

FIG. 4D is a background template containing one or more trees and acloud. It also includes the image of a player in the left position.

FIG. 4E illustrates a player standing in a left position.

FIG. 4F illustrates a player who stands next to one or more trees andthe sun coming out from behind a cloud.

FIG. 4G is a background template containing one or more trees and acloud.

FIG. 4H illustrates a player who stands next to one or more trees, withthe sun coming out from behind a cloud.

FIG. 5 is a simplified flowchart schematically illustrating a thirdexemplary method for object extraction from video images, according toan exemplary embodiment of the present invention.

FIGS. 6A-6O are simplified block diagrams schematically illustrating asecond implementation scenario, according to an exemplary embodiment ofthe present invention.

FIG. 6A illustrates a player who stands in a left position next to oneor more trees and a cloud.

FIG. 6B illustrates a player stands in a right position next to one ormore trees and a cloud.

FIG. 6C illustrates a player who stands in a left position next to oneor more trees and a cloud.

FIG. 6D is a background template containing one or more trees and acloud. It does not include the image of a player.

FIG. 6E is a background template containing one or more trees and acloud. It also includes the image of a player in the right position.

FIG. 6F illustrates a player standing in a left position.

FIG. 6G is a background template containing one or more trees and acloud. It also includes the image of a player in the right position anda player in the left position.

FIG. 6H illustrates a player who stands in a left position.

FIG. 6I illustrates a player who stands in a left position next to oneor more trees and the sun.

FIG. 6J illustrates a player who stands in a right position next to oneor more trees and the sun.

FIG. 6K is a background template containing one or more trees and acloud. It does not include the image of a player.

FIG. 6L illustrates a player who stands in a left position next to oneor more trees and the sun.

FIG. 6M illustrates a player who stands in a right position next to oneor more trees and the sun.

FIG. 6N is a background template containing one or more trees and acloud. It also includes the image of a player in a right position and aplayer in a left position.

FIG. 6O shows a player standing in a right position.

FIG. 7 is a block diagram schematically illustrating an exemplarycomputer readable medium storing computer executable instructions forperforming steps of object extraction from video images, according to anexemplary embodiment of the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present embodiments comprise an apparatus and a method for objectextraction from video images, say from video images of a sport event,which are captured and streamed live during the sport event.

Indeed, the extraction of objects of interest from video images is aknown aspect of image processing—in general, and of video analysis—inparticular.

Specifically, an extraction of objects of interest (say a moving ball)may be used for real time analysis of sport events when being capturedlive by video cameras, say in order to localize the objects of interestand track their movements in a constrained environment (say a tenniscourt) in which the sport events takes place.

For example, an object of interest such as a moving ball, a runningplayer, or an implement (say a tennis racket or a golf club), in use bya player during a sport event, may be extracted from the video images,in a process which involves a discarding of background from the videoimages.

The background is usually made of static objects (say a grass area of acourt of tennis, lampposts, fences, walls, etc.), as captured in theimage, but may additionally or alternatively include non-static objects(say an audience or moving tree leaves).

The discarding of background from an image may be carried out using oneof several current background subtraction techniques.

An exemplary discarding of the background may be generally described asa method which includes a step of deriving a background template,usually from images acquired prior to acquiring an image of interest.The background template may be, for example, in a form of an image of asame size and dimensions as the acquired images. In the exemplarybackground template, pixels in areas of the images acquired prior toacquiring an image of interest, which appear to have minimal value (sayintensity value) fluctuations and are within a predefined range ofvalues, are marked as background pixels, as known in the art.

The derivation of the background template may be followed by a step ofcalculating a difference between the image of interest and thebackground template, say by calculating an intensity difference betweeneach pixel of the image of interest and a pixel in the same position inthe background template, as described in further detail hereinbelow.

The step of calculating the difference may be followed by a step ofusing a threshold, to extract an object of interest from the calculateddifference, such that each pixel with an intensity difference greaterthan the threshold's value is deemed to belong to the object ofinterest.

The above described discarding of background may be carried out usingone of several background subtraction techniques currently known in theart.

However, for any given set of video images, different backgroundsubtraction technique may potentially yield different results. Further,a variety of other parameters such as the number of images used forcalculating the background template, or the threshold value in use, mayalso change the result.

Thus, the quality of the result depends on the background subtractiontechnique in use, as well as on parameters such as the number of imagesused for deriving the background template, or the threshold value inuse, as described in further detail hereinbelow.

Further, the result's quality may depend on the nature of the background(say a changing audience vs. a rather static fence or wall), on thenature of the objects of interest (say on their speed of movement), etc.The result's quality may also depend on compatibility between thebackground subtraction technique and the parameters used whenimplementing the technique, as described in further detail hereinbelow.

Present embodiments are based on a discarding of background form animage, using two or more background templates. The background templatesare derived from one or more video images, say from the image itself,from video images received earlier than the image, or from both theimage itself and the images received earlier. The background templatesmay be derived using different background subtraction techniques, usingpartially different (say partially more recent) subsets of the imagesreceived earlier, etc., as described in further detail hereinbelow.

Thus, according to some embodiments of the present invention, there arereceived two or more video images, and two or more background templatesare derived from the received video images.

Each one of the background templates may be derived using a method basedon a different background subtraction technique, using a differentsubset of the received images (say an at least partially more recentsubset of the received images, a subset consisting of a different numberof video images), etc., as described in further detail hereinbelow.

Then, there are calculated a plurality of differences from an individualone of the video images, say from a most recently received one of thevideo images, which most recently received image is also referred tohereinbelow, as a current image.

Thus, for example, upon receipt of the current video image, from whichan object of interest such as a ball in a soccer field, needs to beextracted, there are calculated a plurality of differences from thatcurrent video image. Each one of the differences is calculated betweenthe current video image and a respective and different one of thecalculated background templates, as described in further detailhereinbelow.

Each one of the differences may be calculated according to method basedon a different background subtraction technique, using a differentthreshold used for binarizing the difference, etc., or using anycombination thereof, as described in further detail hereinbelow.

Then, there is extracting an object of interest from the individual (saycurrent) video image, using a rule which is applied on the calculateddifferences. The rule may be selected according to circumstances ofcapturing of the video images (say on weather conditions, time of day,or an indoor capturing vs. an outdoor capturing), according to thenature of the object of interest, etc., or any combination thereof.

Potentially, with the selected rule, different background subtractiontechniques and/or parameter choices may be dynamically combined andbalanced, so as to yield an optimized result, say using Booleanoperators, preferences over different background templates, conditionaluses of background templates, etc.

The principles and operation of an apparatus, a method, and a computerreadable medium, according to the present invention may be betterunderstood with reference to the drawings and accompanying description.

Before explaining at least one embodiment of the invention in detail, itis to be understood that the invention is not limited in its applicationto the details of construction and the arrangement of the components setforth in the following description or illustrated in the drawings.

The invention is capable of other embodiments or of being practiced orcarried out in various ways. Also, it is to be understood that thephraseology and terminology employed herein is for the purpose ofdescription and should not be regarded as limiting.

Reference is now made to FIG. 1, which is a block diagram schematicallyillustrating an exemplary apparatus for object extraction from videoimages, according to an exemplary embodiment of the present invention.

An apparatus 10 for controlling cameras in a sport event, according toan exemplary embodiment of the present invention, includes a computer.The computer may include a single computer, a group of computers incommunication over a network, one or more electric circuits, or anycombination thereof.

The apparatus 10 further includes one or more additional parts, such asthe parts denoted 11-15 in FIG. 1. The additional parts may beimplemented as software, as hardware, or as a combination of hardwareand software, on the computer, as described in further detailhereinbelow.

In one example, the apparatus 10 communicates with one or more cameras,for receiving images, say for receiving live video images of a sportevent such as a tennis match or a soccer game, as described in furtherdetail hereinbelow.

The apparatus 10 includes a video image receiver 11, implemented on thecomputer.

The video image receiver 11 receives one or more images (say a videostream) from the one or more cameras, as described in further detailhereinbelow.

For example, the video images may be images which the video imagereceiver 11 receives in one or more video streams of images capturedlive by one or more of the cameras during a tennis match, one or morestills images which capture the empty tennis court before the matchbegins and the court, ball and players during the match, etc.

The apparatus 10 further includes a background template deriver 12, incommunication with the video image receiver 11.

The background template deriver 12 derives two or more backgroundtemplates. Each one of the background templates is derived from one ormore of the received video images, say from the stills image whichcaptures the empty tennis court before the match begins, from a subsetof the received live video stream's images, etc., as described infurther detail hereinbelow.

Optionally, the background template deriver 12 derives the backgroundtemplates, using one or more current background subtraction methods.

For example, with rather basic background subtraction methods, thebackground template may simply be the stills image captured before thematch begins or rather an image in which each pixel's grey levelintensity is a median or average of grey level intensities of pixels ofa same position, in some or all of the video images received by thevideo image receiver 11.

The background template deriver 12 may additionally or alternativelyderive the background templates, using other background subtractionmethods, say using methods based on one or more running Gaussianaverages, using Kernel Eigen-background methods, using methods based onmovement detection, using methods based on shape filters, etc., as knownin the art.

Optionally, the background template deriver 12 derives each one of atleast two of the background templates, using a respective and differentone of a plurality of background calculation methods.

Optionally, the background template deriver 12 derives each one of atleast two of the background templates, using a respective and at leastpartially different subset of the video images received by the videoimage receiver 11.

Optionally, the background template deriver 12 derives each one of atleast two of the background templates, using a respective and at leastpartially less recent subset of the video images received by the videoimage receiver 11.

Thus, in one example, a first one of the background templates is derivedfrom recent twenty of the received video images, whereas a second one ofthe background templates is derived from recent thirty of the receivedvideo images. Consequently, the second background template's thirtyimages include ten images less recent than the first backgroundtemplate's twenty images. The second background template is thus atleast partially less recent than the first background template.

Optionally, the background template deriver 12 derives each one of atleast two of the background templates, using a respective and differentfrequency of sampling of the received video images, be the frequencybased on time, on order of receipt by the video image receiver 11, etc.

Thus, in one example, the background template deriver 12 derives a firstbackground template from ten of the received video images of a sequenceof video images streamed to apparatus 10. Each one of the ten videoimages is an image received by the video image receiver 11 a couple ofseconds before the next one of the ten images (say with a number ofvideo images received in between the two images).

In the example, the background template deriver 12 further derives asecond background template from ten of the video images received by thevideo image receiver 11.

However, each one of the ten video images which the second backgroundtemplate is derived 22 from, is an image received by the video imagereceiver 11 three seconds before the next one of the ten images (i.e.with a greater number of images received in between the two images).

Similarly, in another example, the background template deriver 12derives a first background template from twenty of the video images of asequence of video images streamed to apparatus 10 from one or more ofthe cameras, and received by the video image receiver 11. In theexample, the twenty images include each tenth image streamed from thecamera, thus each one of the twenty images is an image received tenth inthe sequence, after an image added earlier to the twenty images.

In the example, the background template deriver 12 further derives asecond background template from twenty of the received video images ofthe sequence of video images streamed to apparatus 10.

However, the twenty images include each fifth image, thus each one ofthe twenty images is an image received 21 fifth in the sequence streamedfrom the camera, after an image added earlier to the twenty images.

Optionally, the background template deriver 12 derives each one of atleast two of the background templates using a respective and differentin size subset of the video images received by the video image receiver11.

Thus, in one example, the background template deriver 12 derives a firstone of the background templates from twenty of the received videoimages, whereas the background template deriver 12 derives a second oneof the background templates from ten of the received video images, asdescribed in further detail hereinbelow.

Optionally, the background template deriver 12 further updates each oneof at least two of the background templates, with a respective anddifferent update rate.

Thus, in one example, the background template deriver 12 derives a firstbackground template from a subset which consists of twenty of thereceived video images. Every ten seconds, the background templatederiver 12 updates the first background template, by discarding oneimage of earliest receipt among the twenty images, from the subset, andadding an image received by the video image receiver 11 immediatelybefore the updating, to the subset.

Then, the background template deriver 12 derives (i.e. re-calculates)the first background template again, according to the thus updatedsubset of twenty images. Thus, the background template deriver 12derives the first background template dynamically, with an update rateof ten seconds.

In the example, the background template deriver 12 derives a secondbackground template from a subset which also consists of twenty of thereceived video images. Every five seconds, the background templatederiver 12 updates the second background template, by discarding oneimage of earliest receipt among the twenty images, from the subset, andadding an image received by the video image receiver 21 immediatelybefore the updating, to the subset.

Then, the background template deriver 12 derives (i.e. re-calculates)the second background template again, according to the thus updatedsubset of twenty images. Thus, the second background template is alsoderived dynamically by the background template deriver 12. However, thesecond background template is rather derived by the background templatederiver 12, with an update rate of five seconds.

In one example, the apparatus 10 is used for implementing a method forlocating objects of interest, such as a ball or a player, during a sportevent, and for tracking the movements of the objects of interest, in athree dimensional space. The three dimensional space represents aconstrained environment, say of a tennis court's environment or afootball field's environment.

In the example, the apparatus 10 communicates with one or more camerasduring a live sport event. During the sport event each one of thecameras feeds a stream of live images to the video image receiver 11.

Optionally, the fed streams of video images are used to build a threedimensional (3D) model of a constrained environment of the sport event(say the tennis court) and the movement of the players and ball therein,say through stereoscopic analysis, as known in the art.

In the example, there is needed to extract an object of interest (say atennis ball or a soccer player) from an individual one of the receivedvideo images, say from each fed stream of video images' most recentimage. The object of interest is extracted from the individual image,using two or more background templates. Each one of the backgroundtemplates is derived from one or more of the fed stream's video images,say from the fed stream's images received prior to that most recentimage (i.e. some or all of the sequence's earlier images), as describedin further detail hereinbelow.

The apparatus 10 further includes a difference calculator 14, incommunication with the background template deriver 12.

The difference calculator 14 calculates a plurality of differences fromthe individual one of the received video images, say from the mostrecently received one of the video images, also referred to hereinbelowas the current image.

Each one of the differences is calculated between the individual videoimage and a respective and different one of the background templatesderived by the background template deriver 12. Thus, for calculatingeach one of the differences, the difference calculator 14 uses adifferent one of the background templates derived by the backgroundtemplate deriver 12, as described in further detail hereinbelow.

The apparatus 10 further includes an object extractor 15, incommunication with the difference calculator 14.

The object extractor 15 extracts one or more objects of interest fromthe individual (say current) video image, using a rule applied on thedifferences calculated by the difference calculator 14, as described infurther detail hereinbelow.

The rule serves as a basis for comparison, weighting, or any otherpattern of decision making, according to which decision making, theportion of the individual image in which the object of interest iscaptured, is identified by the object extractor 15, thus extracting theobject of interest, as described in further detail hereinbelow.

Optionally, a user of apparatus 10 is allowed to select the rule appliedon the calculated differences among two or more rules predefined by auser, administrator, or developer of apparatus 10, or rather to select arule by inputting the rule himself.

In one example, the apparatus 10 further includes a graphical userinterface which is operable by a user or an administrator of apparatus10, for selecting the rule applied on the calculated differences or fordefining the rule using natural language, as known in the art.

Additionally or alternatively, the object extractor 15 may select therule applied on the calculated differences automatically, as describedin further detail hereinbelow.

Optionally, the object extractor 15 automatically selects the ruleapplied on the calculated differences among two or more alternativerules predefined by a user, administrator, or developer of apparatus 10.For example, the rule may be selected according to user input orautomatically set parameters, such as weather conditions (say cloudy vs.sunny), an average speed of the object of interest (say a ball), a timeof day, etc.

Optionally, the object extractor 15 automatically selects the ruleapplied on the calculated differences, among the two or more predefinedrules, according to circumstances of capturing of the video images. Thecircumstances may include, for example, a type of a sport event capturedin the video images (say Tennis vs. Golf), weather conditions (saycloudy vs. sunny), time of day (say evening vs. morning), etc., or anycombination thereof.

Thus, in one example, when an optical sensor, or a user input data,indicates a sunny weather, the applied rule may give less (or even zero)weight to calculated differences based on background templates derivedfrom a small subset of the video images. For example, the rule maydictate relying only on the below example's difference based on thebackground template derived from the recent twenty video images whilediscarding the background templates derived from ten and five of thereceived video images.

In another example, when the optical sensor or user input data indicatesa partially cloudy weather, the applied rule may give a same weight todifferences based on background templates derived from subsets of thereceived video images, which subsets differ in their sizes, say byrelying on a logical conjunction applied on the below example's threedifferences.

In yet another example, when the optical sensor indicates a cloudyweather, the applied rule may be based only on two of the belowexample's differences, say on a logical conjunction applied only on thebelow example's two differences which are based on the backgroundtemplates derived from the ten and five video images.

Optionally, the object extractor 15 automatically selects the ruleapplied on the calculated differences among the two or more predefinedrules, according to a characteristic which pertains to the object ofinterest. For example, the rule applied on the calculated differencesmay be automatically selected according to the object of interest's (sayplayer's) size or average speed, as measured during the tennis match (orduring previously played matches), or as input (say by a user oradministrator of the apparatus 10).

Thus, in one example, with a different size or average speed of theobject of interest, a different one or two of the below made example'sthree calculated differences, may be used, to extract the object ofinterest, say using a Boolean or other rule applied on the one or twodifferences, as described in further detail hereinbelow.

Optionally, the object extractor 15 automatically selects the ruleapplied on the calculated differences, among the two or more predefinedrules, according to a characteristic which pertains to the background,say the background's being more static (say a fence or gate) as apposedto the background's being less static (say an audience of sport fans).

Optionally, the object extractor 15 determines the background'scharacter, say if the background is more static or less static, saybased on data input by a user of the apparatus 10, based on processingof audio input which originates from the audience areas, etc.

Thus, in one example, with a background which the object extractor 15determines to be less static, the object extractor 15 uses one of thecalculated differences, to extract the object of interest. However, witha background which the object extractor 15 determines to be more static,the object extractor 15 uses another one of the calculated differences,to extract the object of interest.

Optionally, the deriving of the background templates by the backgroundtemplate deriver 12, is also based on a rule which the backgroundtemplate deriver 12 selects automatically among two or more predefinedrules, or rather on a rule which is selected by a user, say using agraphical user interface, a natural language, etc., as described infurther detail, and illustrated using FIG. 2, hereinbelow

Optionally, the apparatus 10 further includes a binarizer, incommunication with said difference calculator 14.

The binarizer binarizes the differences calculated by the differencecalculator 14, say using a threshold value, as described in furtherdetail hereinbelow.

In one example, after the binarizer binarizes the calculateddifferences, using the threshold value, the object extractor 15automatically selects a rule based on a logical conjunction, and appliesthe rule on the differences, by applying logical conjunction among thebinarized differences. By applying the logical conjunction among thebinarized differences, the object extractor 15 extracts the object ofinterest from the individual (say current) video image.

More specifically, in the example, the received images are grayscaledigital images of a same video stream, and the individual video image isthe video stream's most recent image, also referred to hereinbelow asthe current image.

In the example, the background template deriver 12 derives each pixel ineach one of the background templates, by averaging over grayscaleintensity values of all pixels of a same position, in a different numberof the received video images.

For example, a first background template is derived by averaging overthe intensity values of pixels in a same position in recent twenty ofthe received video images. A second background template is derived byaveraging over intensity values of pixels in a same position in recentten of the received video images. Further, a third background templateis derived by averaging over intensity values of pixels in a sameposition in recent five of the received video images.

In the example, the difference calculator 14 calculates a differencebetween the current image and each one of the three backgroundtemplates, respectively, thus calculating a difference per each one ofthe three background templates. The resultant three differences are inthe form of an image of a same size as of each one of the received videoimages.

In the difference, each pixel's grayscale intensity equals thedifference between the current image's grayscale intensity in that pixel(i.e. in the same position) and the average intensity for that pixel'sposition, as indicated in the background template (say the grayscaleintensity of the background template in that pixel position).

Optionally, for binarizing the difference, the binarizer compares eachone of the difference's pixels to a threshold. The threshold's value maybe set manually, say by a user of apparatus 10, using the graphical userinterface.

Alternatively, the binarizer may determine the threshold automatically,say according to a rule based on user input or automatically setparameters, such as weather conditions (say cloudy vs. sunny), anaverage speed of the object of interest (say a ball), a time of day,etc.

In one example, if the grayscale intensity of the difference's pixelexceeds the threshold's value, the binarizer sets the pixel's grayscaleintensity to a value representing a binary ‘1’, say to maximum.Otherwise, the binarizer sets the pixel's grayscale intensity to a valuerepresenting a binary ‘0’, say to minimum.

Then, in accordance with a rule used in the instant example, a logicalconjunction is applied among the three binarized differences, forextracting the object of interest. Each pixel set to a binary ‘1’ in allthree differences, is deemed to mark a respective current image's pixelposition occupied by the object of interest, and the remaining pixelsare deemed to mark positions of the current image's background, asdescribed in further detail hereinbelow.

That is to say that in the instant example, a logical conjunction of thebinarized differences results in a binary (say black and white) imagewhich maps the current image's area which is occupied by the object ofinterest.

Reference is now made to FIG. 2, which is a simplified flowchartschematically illustrating a first exemplary method for objectextraction from video images, according to an exemplary embodiment ofthe present invention.

A first exemplary method for object extraction from video images,according to an exemplary embodiment of the present invention, may beexecuted by a computer. The computer may include a single computer, agroup of computers in communication over a network, one or more electriccircuits, or any combination thereof.

In one example, for carrying out the first exemplary method, thecomputer communicates with one or more cameras, through the internet, anintranet network, a local area network, another network, or anycombination thereof, for receiving video images captured live during asport event, as described in further detail hereinbelow.

In the method, there are received 21 one or more video images, say bythe video image receiver 11 of apparatus 10, as described in furtherdetail hereinabove.

In one example, there is received 21 a live video stream of imagescaptured live by one or more cameras during a tennis match, one or morestills images which capture the empty tennis court before the matchbegins, and the court, ball and players during the match, etc.

Next, there are derived 22 two or more background templates from thereceived 21 video images, say by the background template deriver 12 ofapparatus 10, as described in further detail hereinabove.

Optionally, the background templates are derived 22 using one or morecurrent background subtraction methods, as described in further detailhereinabove.

For example, with rather basic background subtraction methods, thebackground template may simply be the stills image captured before thematch begins or rather an image in which each pixel's grey levelintensity is a median or average of grey level intensities of pixels ofa same position, in some or all of the received 21 video images, asdescribed in further detail hereinabove.

The background templates may also be derived 22 with other backgroundsubtraction methods, say with methods based on one or more runningGaussian averages, with Kernel Eigen-background methods, with methodsbased on movement detection, with methods based on shape filters, etc.,as known in the art.

Optionally, each one of at least two of the background templates isderived, using a respective and different one of a plurality ofbackground calculation methods.

Optionally, each one of at least two of the background templates isderived 22 using a respective and at least partially different subset ofthe received 21 video images.

Optionally, each one of at least two of the background templates isderived 22 using a respective and at least partially less recent subsetof the received 21 video images.

Thus, in one example, a first one of the background templates is derived22 from recent twenty of the received 21 images, whereas a second one ofthe background templates is derived 22 from recent thirty of thereceived 21 images. Consequently, the second background template'sthirty images include ten images which are less recent than the firstbackground template's twenty images. The second background template isthus at least partially less recent than the first background template.

Optionally, each one of at least two of the background templates isderived 22 using a respective and different frequency of sampling of thereceived 21 video images, be the frequency based on time, on order ofreceipt 21, etc., as described in further detail hereinabove.

Thus, in one example, a first background template is derived 22 from tenof the received 21 images of a sequence of video images streamed toapparatus 10, say from one of the cameras. Each one of the ten videoimages is an image received 21 a couple of seconds before the next oneof the ten video images (say with a number of video images in betweenthe two video images).

In the example, a second background template is also derived 22 from tenof the received 21 video images. However, each of the ten video imageswhich the second background template is derived 22 from, is an imagereceived 21 three seconds before the next one of the ten video images(i.e. with a greater number of video images in between the two videoimages).

Similarly, in another example, a first background template is derived 22from twenty of the received 21 video images of a sequence of videoimages streamed to apparatus 10, say from one of the cameras. In theexample, the twenty video images include each tenth video image streamedfrom the camera, thus each one of the twenty video images is an imagereceived 21 tenth in the sequence, after an image added earlier to thetwenty video images.

In the example, a second background template is also derived 22 fromtwenty of the received 21 video images of the sequence of video imagesstreamed to apparatus 10. However, the twenty video images include eachfifth video image, thus each one of the twenty video images is an imagereceived 21 fifth in the sequence streamed from the camera, after animage added earlier to the twenty video images.

Optionally, each one of at least two of the background templates isderived 22 using a respective and different in size subset of thereceived 21 video images. Thus, in one example, a first one of thebackground templates is derived 22 from twenty of the received 21 videoimages, whereas a second one of the background templates is derived 22from ten of the received 21 video images, as described in further detailhereinabove.

Optionally, the method further includes updating each one of at leasttwo of the background templates, with a respective and different updaterate, say by the background template deriver 12, as described in furtherdetail hereinabove.

Thus, in one example, a first background template is derived 22 from asubset which consists of twenty of the received 21 video images. Everyten seconds, the first background template is updated by discarding oneimage of earliest receipt 21 among the twenty video images, and addingan image received 21 immediately before the updating, to the subset.

Then, the first background template is derived 22 again (i.e.re-calculated), according to the thus updated subset of twenty videoimages. Thus, the first background template is derived 22 dynamically,with an update rate of ten seconds.

In the example, a second background template is derived 22 from a subsetwhich also consists of twenty of the received 21 video images. Everyfive seconds, the second background template is updated by discardingone image of earliest receipt 21 among the twenty video images, andadding an image received 21 immediately before the updating, to thesubset.

Then, the second background template is derived 22 again (i.e.re-calculated), according to the thus updated subset of twenty videoimages. Thus, the second background template is also derived 22dynamically. However, the second background template is rather derived22 with an update rate of five seconds.

In one example, the first exemplary method is used as a part of a methodfor locating objects of interest, such as a ball or a player, during asport event, and for tracking the movements of the objects of interest,in a three dimensional space. The three dimensional space represents aconstrained environment, say of a tennis court's environment or afootball field's environment, and movement of the object therein, asdescribed in further detail hereinabove.

In the example, the apparatus 10 communicates with one or more camerasduring a live sport event. During the sport event each one of thecameras feeds a stream of live images to the video image receiver 11.

Optionally, the fed streams of video images are used to build a threedimensional (3D) model of a constrained environment of the sport event(say the tennis court) and the movement of the players and ball therein,say through stereoscopic analysis, as known in the art.

In the example, there is needed to extract an object of interest (say atennis ball or a soccer player) from an individual one of the received21 video images, say from each fed stream of video images' most recentimage.

The object of interest is extracted 25 from the individual image, usingtwo or more background templates. Each one of the background templatesis derived 22 from one or more of the fed stream's video images, sayfrom the fed stream's images received 21 prior to that most recent image(i.e. some or all of the sequence's earlier images), as described infurther detail hereinbelow.

Then, there are calculated 24 a plurality of differences, say by thedifference calculator 14 of apparatus 10, as described in further detailhereinabove. Each one of the differences is calculated 24 between theindividual (say current) video image and a respective and different oneof the derived 22 background templates. Thus, the derived 22 backgroundtemplate used for calculating 24 each difference, is a different one.

Subsequently, one or more objects of interest is extracted 25 from theindividual video image, using a rule applied on the calculated 24differences, say by the object extractor 15 of apparatus 10, asdescribed in further detail hereinabove.

The rule serves as a basis for comparison, weighting, or any otherpattern of decision making, according to which decision making, theportion of the individual video image in which the object of interest iscaptured, is identified, thus extracting 25 the object of interest fromthe individual video image.

The rule applied on the calculated 24 differences may be selected by auser, or rather be selected automatically, say by apparatus 10, asdescribed in further detail hereinabove.

In one example, the method further comprises binarizing the calculated24 differences, using a threshold value, and the rule applied on thedifferences dictates applying logical conjunction among the binarizeddifferences, for extracting 25 the object of interest.

More specifically, in the example, the received 21 video images aregrayscale digital images which belong to a same video stream. Theindividual image is the video stream's most recent image (also referredto hereinbelow as the current image), and two or more backgroundtemplates are derived 22 from the received 21 video images. Each one ofthe background templates is derived 22 from one or more of the received21 images, say from a different number of the received 21 video stream'searlier images, as described in further detail hereinabove.

In the example, each pixel in each one of the background templates isderived 22 by averaging over grayscale intensity values of all pixels ofa same position, in a different number of the video images used forderiving 22 the background template.

For example, a first background template is derived 22 by averaging overthe intensity values of pixels in a same position in recent twenty ofthe received 21 video images. A second background template is derived 22by averaging over intensity values of pixels in a same position inrecent ten of the received 21 video images. Further, a third backgroundtemplate is derived 22 by averaging over intensity values of pixels in asame position in recent five of the received 21 video images.

In the example, a difference is calculated 24 between the individual,say current (i.e. the most recent) image and each one of the threebackground templates, respectively, thus calculating 24 a difference pereach one of the three background templates. The resultant difference isin the form of an image of a same size as of each one of the received 21video images.

In the difference, each pixel's grayscale intensity value equals thedifference between the individual (say current) image's grayscaleintensity in that pixel (i.e. in the same position) and the averageintensity for that pixel's position, as indicated in the backgroundtemplate (say the grayscale intensity of the background template in thatpixel position).

Optionally, for binarizing the difference, each one of the difference'spixels is compared to a threshold. The threshold's value may be setmanually—say by a user of apparatus 10, or rather be determinedautomatically—say according to a rule based on user input orautomatically set parameters, such as weather conditions (say cloudy vs.sunny), an average speed of the object of interest (say a ball), a timeof day, etc.

In one example, if the grayscale intensity value of the difference'spixel exceeds the threshold value, the pixel's grayscale intensity isset to a value representing a binary ‘1’, say to maximum. Otherwise, thepixel's grayscale intensity is set to a value representing a binary ‘0’,say to minimum.

Then, in accordance with a rule used in the instant example, a logicalconjunction is applied among the three binarized differences, forextracting 25 the object of interest. Each pixel set to a binary ‘1’ inall three differences, is deemed to mark a respective individual (saycurrent) image's pixel position occupied by the object of interest. Theremaining pixels are deemed to mark positions of the individual image'sbackground, as described in further detail hereinbelow.

That is to say that in the instant example, a logical conjunction of thebinarized differences results in a binary (say black and white) imagewhich maps the individual image's area which is occupied by the objectof interest.

Optionally, a user of apparatus 10 is allowed to select the rule appliedon the calculated 24 differences among two or more rules predefined by auser, administrator, or developer of apparatus 10, or rather to selectthe rule by inputting the rule himself (say using natural language, aGUI, etc., as known in the art).

Optionally, the rule applied on the calculated 24 differences isautomatically selected among two or more alternative rules predefined bya user, administrator, or developer of apparatus 10, say by the objectextractor 15. For example, the rule may be selected according to a userinput or according to automatically set parameters, such as weatherconditions (say cloudy vs. sunny), an average speed of the object ofinterest (say a ball), a time of day, etc.

Optionally, the rule applied on the calculated 24 differences isautomatically selected among the two or more predefined rules, accordingto circumstances of capturing of the video images. The circumstances mayinclude, for example, a type of a sport event captured in the images(say Tennis vs. Golf), weather conditions (say cloudy vs. sunny), timeof day (say evening vs. morning), etc., or any combination thereof.

Thus, in one example, when an optical sensor, or a user input data,indicates a sunny weather, the applied rule may give less (or even zero)weight to calculated 24 differences based on background templatesderived 22 from a small subset of the received 21 video images. Forexample, the rule may dictate relying only on the above example'sdifference based on the background template derived from the recenttwenty of the received 21 video images while discarding the backgroundtemplates derived 22 from ten and five of the received 21 video images.

In another example, when the optical sensor or user input data indicatesa partially cloudy weather, the applied rule may give a same weight todifferences based on background templates derived 22 from subsets ofdifferent sizes, say by relying on a logical conjunction applied on theabove example's three differences.

In yet another example, when the optical sensor indicates a cloudyweather, the applied rule may be based on only two of the aboveexample's differences, say on a logical conjunction applied only on theabove example's two differences which are based on the backgroundtemplates derived from the ten and five video images.

Optionally, the rule applied on the calculated 24 differences isautomatically selected among the two or more predefined rules, accordingto a characteristic which pertains to the object of interest. Forexample, the rule applied on the calculated 24 differences may beautomatically selected according to a size or an average speed of theobject (say a ball or player), as measured during the match (or duringpreviously played matches), or as input by a user, as described infurther detail hereinabove.

Thus, in one example, with a different size or average speed of theobject of interest, a different one or two of the above made example'sthree calculated 24 differences, may be used, to extract 25 the objectof interest, say using a Boolean or other rule applied on the one or twodifferences, as described in further detail hereinabove.

Optionally, the rule applied on the calculated 24 differences isautomatically selected among the two or more predefined rules, accordingto a characteristic which pertains to the background, say thebackground's being more static (say a fence or gate) as apposed to thebackground's being less static (say an audience of sport fans).

Optionally, the background's being more static or less static isdetermined by the object extractor 15 of apparatus 10, say based on datainput by a user of the apparatus 10, based on processing of audio inputwhich originates from the audience areas, etc.

Thus, in one example, with a background which is less static, one of thecalculated 24 differences may be used, to extract 25 the object ofinterest, whereas with a background which is more static, another one ofthe calculated 24 differences may be used, to extract 25 the object ofinterest.

Optionally, the deriving 22 of the background templates is based a ruleselected among two or more of predefined rules.

Optionally, a user of apparatus 10 is allowed to select the rule usedfor the deriving 22 the background templates among two or more rulespredefined by a user, administrator, or developer of apparatus 10, orrather to select the rule by inputting the rule himself (say usingnatural language, and a graphical user interface, as known in the art),as described in further detail hereinabove.

Optionally, the rule used for deriving 22 the background templates, isautomatically selected among two or more rules predefined by a user,administrator, or developer of apparatus 10.

For example, the rule may be selected according to a user input oraccording to automatically set parameters, such as weather conditions(say cloudy vs. sunny), an average speed of the object of interest (saya ball), a time of day, etc.

Optionally, the rule used for the deriving 22 the background templates,is automatically selected among the two or more predefined rules,according to circumstances of capturing of the received 21 video images.The circumstances may include, for example, a type of a sport eventcaptured in the video images (say Tennis vs. Golf), weather conditions(say cloudy vs. sunny), time of day (say evening vs. morning), etc., orany combination thereof.

For example, the rule may dictate the derivation 22 of differentbackground templates upon different types of sport events captured inthe received 21 video images (say Tennis vs. Golf), different weatherconditions (say cloudy vs. sunny), different times of day (say eveningvs. morning), etc., or any combination thereof.

Thus, in one example, when an optical sensor or a user input dataindicates a sunny weather, there may be derived 22 only a backgroundtemplate based on recent twenty of the received 21 video images and abackground template based on recent ten of the received 21 video images,whereas in a more cloudy weather, there may be additionally derived 22 abackground template based on recent five of the received 21 videoimages.

Optionally, the rule used for deriving 22 the background templates, isautomatically selected among the two or more predefined rules, accordingto a characteristic which pertains to the object of interest. Thecharacteristic may be for example, a size or an average speed of theball or player, as measured during the tennis match (or duringpreviously played tennis matches), or as input (say by a user oradministrator), as described in further detail hereinabove.

Thus, in one example, with a different size or average speed of theobject of interest, a different one or two of the above made example'sthree background templates may be calculated.

Optionally, the rule used for deriving 22 the background templates, isautomatically selected among the two or more predefined rules, accordingto a characteristic which pertains to the background, say thebackground's being more static (say a fence or gate) as apposed to thebackground's being less static (say an audience of sport fans).

Optionally, the background's being more static or less static isdetermined by the object extractor 15 of the apparatus 10, say based ondata input by a user of the apparatus 10, based on processing of audioinput originating from the audience areas, etc., as described in furtherdetail hereinabove.

Thus, in one example, with a different size or average speed of theobject of interest, a different one or two of the above made example'sthree background templates may be derived 22.

Reference is now made to FIG. 3, which is a simplified flowchartschematically illustrating a second exemplary method for objectextraction from video images, according to an exemplary embodiment ofthe present invention.

A second exemplary method for object extraction from video images,according to an exemplary embodiment of the present invention, may beexecuted by a computer - as described in further detail hereinabove.

In one example, for carrying out the exemplary method, the computercommunicates with one or more cameras, through the internet, an intranetnetwork, a local area network, another network, or any combinationthereof. The computer received from the camera, a sequence of videoimages 31 (i.e. frames) made of images 30 of a moving object (say aplayer running in a football field) as captured live during a sportevent, by the camera, as described in further detail hereinabove.

The second exemplary method aims at extracting the moving object from acurrent image 32 of the sequence of video images 31, as received, i.e.from the most recently received one of the sequence's images 31, in realtime or in near real time.

In the second method, there is used a method of one of currentbackground subtraction methods, for deriving a background template 33(say a in a form of an image) from images of the video sequence 31, sayby the background template deriver 12, as described in further detailhereinabove.

Then, a difference 34 is calculated between the current image 32 and thebackground template 33, and subjected to binarization using a threshold35, as described in further detail hereinbelow.

In one example, all images of the video stream 31 are grayscale digitalimages.

In the example, each pixel in the background template 33 is derived byaveraging over grayscale intensity values of all pixels of a sameposition, in the video sequence's images 31 used for deriving thebackground template 33 (say in the images received prior to the currentimage 32).

In the example, a difference 34 is calculated between the current image32, and the background template 33. The resultant difference 34 is in aform of an image of a same size as of each one of the sequence's images31.

In the difference 34, each pixel's grayscale intensity value equals thedifference between the current image's 32 grayscale intensity in thatpixel (i.e. in the same position) and the average intensity for thatpixel's position, as indicated in the background template 33 (say thegrayscale intensity of the background template 33 in that pixelposition).

For binarizing the difference 34, each one of the difference's 34 pixelsis compared to a threshold 35. The threshold's 35 value may be setmanually—say by a user of apparatus 10, or rather be determinedautomatically—say according to a rule based on user input orautomatically set parameters, such as weather conditions (say cloudy vs.sunny), an average speed of the object of interest (say a ball), a timeof day, etc.

In one example, if the grayscale intensity value of the difference's 34pixel exceeds the threshold 35 value, the pixel's grayscale intensity isset to a value representing a binary ‘1’, say to maximum. Otherwise, thepixel's grayscale intensity is set to a value representing a binary ‘0’,say to minimum.

With the single background template 33, in the resultant singlebinarized difference 36, each pixel set to a binary ‘1’, is deemed tomark a respective individual (say current) image's 32 pixel positionoccupied by the object of interest, and the remaining pixels are deemedto mark positions of the individual (say current) image's 32 background.

However, an extraction of an object of interest based on the binarizeddifference's 36 pixels set to the binary ‘1’, depends on circumstancesof capturing of the video images 31. The circumstances may include, forexample, a type of a sport event captured in the images 31 (say Tennisvs. Golf), lighting conditions resultant upon different weatherconditions (say cloudy vs. sunny), time of day (say evening vs.morning), etc., or any combination thereof.

Reference is now made to FIGS. 4A-4H, which are simplified blockdiagrams schematically illustrating a first implementation scenario,according to an exemplary embodiment of the present invention.

In one exemplary scenario, a first image is captured during cloudyweather conditions. The first image shows a player 411 who stands nextto one or more trees 412 (say in a golf field), under a cloud 413, inthe cloudy weather, say on a winter day, as illustrated in FIG. 4A.

As the player 411 walks around, the player 411 is also captured in laterreceived images, say in an image in which the player 411 is shownstanding in another position, next to the trees 412, as illustrated inFIG. 4B.

Based on the images in FIG. 4A-4B (possibly, with a number of imagesreceived in between the two images), a background template in a form ofan image of a same size as of each one of the images in FIG. 4A-4B, isderived from the images in FIG. 4A-4B, as illustrated in FIG. 4C.

As shown in FIG. 4C, the background template derived in the cloudyweather, is rather accurate, as the background template includes onlythe trees 412 and cloud 413, which form a background against which, theplayer 411 walks around.

In the exemplary scenario, the player 411 walks back, and is captured inanother image, as illustrated in FIG. 4D.

Consequently, a difference may be calculated between the imageillustrated in FIG. 4D and the background template illustrated in FIG.4C, which difference is useful, for extracting an object of interest,say the player 411 standing at a position left to the trees 412, asillustrated in FIG. 4E.

However, as explained hereinabove, the results of the extraction of theobject of interest depend on circumstances of capturing of the videoimages, say on the lighting conditions resultant upon different weatherconditions (say cloudy vs. sunny), on a different time of day (sayevening vs. morning), etc., or any combination thereof.

For example, when the weather turns sunny, as the sun comes out frombehind the clouds, the player 411 is captured in another image, whichimage is illustrated in FIG. 4F. In the image illustrated in FIG. 4F,under the light shed by the sun 415, both the player 411 and the trees412 have a much brighter appearance than when captured in the previousimages (4A-4D).

With a law enough rate of updating of the background template, when theplayer 411 is captured in the image illustrated in FIG. 4F, thebackground template is still the image based on the cloudy weatherconditions derived from the first images, as illustrated in FIG. 4G.

Under the light shed by the sun 415, all pixels of the image captured inthe sunny weather, and illustrated in FIG. 4F, are of intensity valueswhich correspond to the much brighter appearance, and therefore,significantly differ from their intensity values in the backgroundtemplate illustrated in FIG. 4G.

Consequently, a difference calculated between the pixels of the imagecaptured in the sunny weather (FIG. 4F) and the background template(FIG. 4G), shows all objects captured in the sunny weather, and theextraction of the object of interest fails, as illustrated in FIG. 4H.

On the one hand, with a higher rate of updating of the backgroundtemplate, when the image illustrated in FIG. 4F is captured, thebackground template may already have pixel intensity values which aretypical to a much brighter appearance. The background template mayalready have pixel intensity values typical to a much brighterappearance, because the background template may be, at least partially,based on more sunny ones of the images, as captured after the sun goesout. Consequently, the extraction of the object of interest may besuccessful.

However, the same higher rate of updating of the background template mayprove less effective when the player's 411 movement is too slow, suchthat the player 411 is caught in the background template, as describedin further detail and illustrated using FIG. 6E hereinbelow.

Exemplary embodiments of the present invention extract the object ofinterest, using two or more background templates. Each one of thebackground templates may be derived according to methods of differentbackground subtraction techniques, according to different parametervalues (say different update rates), etc., or any combination thereof,as descried in further detail hereinabove.

Potentially, by combining methods of different background subtractiontechniques and/or different parameter values, there may be yielded, anoptimized result, as described in further detail hereinabove.

Reference is now made to FIG. 5, which is a simplified flowchartschematically illustrating a third exemplary method for objectextraction from video images, according to an exemplary embodiment ofthe present invention.

A third exemplary method for object extraction from video images,according to an exemplary embodiment of the present invention, may beexecuted by a computer—as described in further detail hereinabove.

In one example, for carrying out the exemplary method, the computercommunicates with one or more cameras, through the internet, an intranetnetwork, a local area network, another network, or any combinationthereof, for receiving a sequence of video images 31 (i.e. frames). Thesequence of video images 31 is made of images 30 of a moving object (saya player running in a football field) captured live during a sportevent, by the cameras, as described in further detail hereinabove.

The exemplary method aims at extracting the moving object from a currentimage 32 of the sequence of video images 31, as received, i.e. from themost recently received one of the sequence's images 31, in real time orin near real time.

In the exemplary method, there is used a method of one of the currentbackground subtraction methods, for deriving two or more backgroundtemplates 33, 53 (say a in a form of images) from images of the videosequence 31, say by the background template deriver 12, as described infurther detail hereinabove.

Each one of the background templates 33, 53 may be derived according tomethods of different current background subtraction techniques,different parameter values used when implementing the methods (saydifferent update rates or an at least partially different subset of thevideo images), etc., as described in further detail hereinabove.

Then, a difference 34, 54 is calculated between the current image 32 andeach one of the background templates 33, 53, and is subjected tobinarization using a threshold 35, 55, thus yielding a binarizeddifference 36, 56, as described in further detail hereinabove.

Subsequently, one or more of the binarized differences 36, 56, is usedto extract an object of interest (say the player) 57 from the currentimage 32, say using a logical conjunction applied on the binarizeddifference 36, 56, or rather using another rule, as described in furtherdetail hereinabove.

The rule used for extracting the object of interest 57 may be selectedby a user or an administrator of apparatus 10, or rather be selectedautomatically, say by the object extractor 15, as described in furtherdetail hereinabove.

More specifically, in the example, the sequence of video images 31received, say by the video image receiver 11 of apparatus 10, is made ofgrayscale digital video images.

In the example, each one of the background templates 33, 53 iscalculated by averaging over grayscale intensity values of pixels in asame position in a subset which consists of recent twenty of thereceived video stream's 31 images.

In the example, every ten seconds, the background template deriver 12updates a first one of the background templates 33, by discarding oneimage of earliest receipt among the twenty images used for deriving thefirst background template, from the subset, and adding an image receivedby the video image receiver 11 immediately before the updating, to thesubset. Then, the background template deriver 12 derives (i.e.re-calculates) the first background template 33 again, according to thethus updated subset of twenty images. Thus, the background templatederiver 12 derives the first background template 33 dynamically, with anupdate rate of ten seconds.

However, in the example, every two seconds, the background templatederiver 12 updates a second one of the background templates 53, bydiscarding one image of earliest receipt among the twenty images usedfor deriving the second background template, from the subset, and addingan image received by the video image receiver 11 immediately before theupdating, to the subset. Then, the background template deriver 12derives (i.e. re-calculates) the second background template 53 again,according to the thus updated subset of twenty images. Thus, thebackground template deriver 12 derives the second background template 53dynamically, with an update rate of two seconds.

In the example, a difference 34, 54 is calculated between the currentimage (i.e. the most recent image) 32 and each one of the backgroundtemplates 33, 53, respectively, thus calculating a difference 34, 54 pereach one of the two background templates 33, 53. Each one of theresultant differences is in a form of an image of a same size as of eachone of the received video stream's 31 images.

In the difference, each pixel's grayscale intensity value equals thedifference between the current image's 32 grayscale intensity in thatpixel (i.e. in the same position) and the average intensity for thatpixel's position, as indicated in the respective, background template33, 53 (say the grayscale intensity of the background template in thatpixel position).

For binarizing each one of the differences 34, 54, each one of thedifference's 34, 54 pixels is compared to a threshold 35, 55. Thethreshold 35 used for binarizing the first difference 34 may be the sameor different from the threshold 55 used for binarizing the seconddifference 54. Each one of the thresholds' 35, 55 values may be setmanually—say by a user of apparatus 10, or rather be determinedautomatically—say according to a rule based on user input orautomatically set parameters, such as weather conditions (say cloudy vs.sunny), an average speed of the object of interest (say a ball), a timeof day, etc.

In one example, if the grayscale intensity value of the difference's 34,54 pixel exceeds the threshold value 35, 55, the pixel's grayscaleintensity is set to a value representing a binary ‘1’, say to maximum.Otherwise, the pixel's grayscale intensity is set to a valuerepresenting a binary ‘0’, say to minimum.

Then, in accordance with a rule selected in the instant example, alogical conjunction is applied among the two resultant binarizeddifferences 36, 56, for extracting the object of interest 57. Each pixelset to a binary ‘1’ in both binarized differences 36, 56, is deemed tomark a respective current image's 32 pixel position occupied by theobject of interest 57. The remaining pixels are deemed to mark positionsof the current image's 32 background, as described in further detailhereinabove.

Thus, in the instant example, a logical conjunction of the binarizeddifferences 36, 56 results in a binary (say black and white) image whichmaps the current image's area which is occupied by the object ofinterest 57.

Reference is now made to FIG. 6A-6O, which are simplified block diagramsschematically illustrating a second implementation scenario, accordingto an exemplary embodiment of the present invention.

In one exemplary scenario, a sequence of video images is captured duringpartially cloudy and partially sunny weather conditions, and fed toapparatus 10, as described in further detail hereinabove.

A first one of the video is an image of a player 411 standing next totrees 412 (say in a golf field), under a cloud 413, in a left position,as illustrated in FIG. 6A.

As the player 411 walks around, the player 411 is captured in laterreceived images. For example, in one later received image, the player411 is captured standing in a right position, next to the trees 412, andunder the cloud 413, as illustrated in FIG. 6B.

In a yet later received image, the player 411 is shown again, standingin the left position, next to the trees 412, and under the cloud 413, asillustrated in FIG. 6C.

In the instant example, during receipt of the video images, there aresimultaneously derived two background templates from the video images,say by analyzing movement of objects which appear in the video images.

However, a first one of the background templates is an image derived(i.e. re-calculated) dynamically with an update rate of once in tenseconds, whereas a second one of the background templates is an imagewhich is also derived dynamically, but rather with an update rate ofonce in two seconds, as described in further detail hereinabove.

In the example, when the image illustrated in FIG. 6C is received, sayby the video image receiver 11, due the different update rates, thefirst background template may be based on a subset of the video images,which subset is less recent than a subset of the video images which thesecond background template is based on.

Thus, as shown in FIG. 6D, the first background template is ratheraccurate, as the first background template includes the trees 412 andcloud 413, but does not include the object of interest (i.e. not theplayer 411).

However, as shown in FIG. 6E, the second background template is lessaccurate, as the second background template includes the trees 412 andcloud 413, as well as the object of interest (i.e. the player 411 in theright position). Thus, in the example, due to a standing or slowmovement of the player 411, the second background template is lessaccurate than the first background template.

In the example, a first difference is calculated between the image shownin FIG. 6C when that image is also the last image received by the videoimage receiver 11 (i.e. the current image), and the first backgroundtemplate as shown in FIG. 6D, and subjected to binarization, asdescribed in further detail hereinabove.

The resultant first binarized difference is rather accurate, asillustrated in FIG. 6F, and shows only the object of interest (say theplayer 411).

Further in the example, a second difference is calculated between theimage in FIG. 6C (i.e. the current image) and the second backgroundtemplate as shown in FIG. 6E, and subjected to binarization, asdescribed in further detail hereinabove.

The resultant second binarized difference is less accurate, asillustrated in FIG. 6G, and shows the object of interest (in bothpositions), as well as the trees 412 and cloud 413.

Then, a logical conjunction applied on the two binarized differences,yields the image shown in FIG. 6H, thus extracting the object ofinterest (i.e. the player 411 of the instant example).

Then, the weather turns sunny, and an image received after the imageshown in FIG. 6C, shows the player 411 when standing in a position leftto one of the trees 412, under the sun 415, as illustrated in FIG. 6I.

An image received after the image illustrated in FIG. 6I, shows theplayer 411 back at a position right to the same one of the trees 412,under the sun 415, as illustrated in FIG. 6J.

Again, when the image illustrated in FIG. 6J is received, say by thevideo image receiver 11, due the different update rates, the firstbackground template is based on a subset of the video images, whichsubset is less recent than a subset of the video images which the secondbackground template is based on.

Thus, as shown in FIG. 6K, the first background template includes thetrees 412 and the cloud 413, and does not include the object of interest(i.e. not the player 411). However, the first background template'spixel intensity values are significantly different than the pixelintensity values of the image shown in FIG. 6J, which is captured in thesunny weather conditions, and is thus much brighter and free of clouds413, compared to the cloudy images which the first background templateis based on.

As shown in FIG. 6L, due to a standing or slow movement of the player411, the second background template still includes the trees 412 and sun415, as well as the object of interest (i.e. the player 411 in the leftposition). However, due to a higher update rate, the second backgroundtemplate's pixel intensity values are closer to the pixel intensityvalues of the images shown in FIGS. 6I and 6J, which are captured in thesunny weather conditions, and are much brighter, and free of clouds 413.

In the example, a first difference is calculated between the image shownin FIG. 6J when that image is also the last image received by the videoimage receiver 11 (i.e. the current image), and the first backgroundtemplate as shown in FIG. 6K, which is of a more cloudy and thus lessbright appearance, and subjected to binarization, as described infurther detail hereinabove.

The resultant first binarized difference shows the object of interest(say the player 411) as well as the trees 412 and sun 415, asillustrated in FIG. 6M.

Further in the example, a second difference is calculated between theimage in FIG. 6J (i.e. the current image) and the second backgroundtemplate as shown in FIG. 6L, and subjected to binarization, asdescribed in further detail hereinabove.

In the example, the resultant second binarized difference is even lessaccurate, and shows the object of interest twice (one time per each ofthe two positions at which the player 411 is captured) as well as thetrees 412 and sun 415, as illustrated in FIG. 6N.

However, a logical conjunction applied on the two binarized differences,yields the image shown in FIG. 6O, which shows only the object ofinterest (i.e. the player 411 of the instant example), standing at theright position (as in the image illustrated in FIG. 6J), thussuccessfully extracting the object of interest (i.e. the player 411 ofthe example).

Reference is now made to FIG. 7, which is a block diagram schematicallyillustrating an exemplary computer readable medium storing computerexecutable instructions for performing steps of object extraction fromvideo images, according to an exemplary embodiment of the presentinvention.

According to an exemplary embodiment of the present invention, there isprovided a non-transitory computer readable medium 70, such as a CD-ROM,a USB-Memory, a Hard Disk Drive (HDD), a Solid State Drive (SSD), etc.

The computer readable medium 70 stores computer executable instructions,for performing steps of controlling cameras in a sport event. Theinstructions may be executed upon one or more computer processors.

The computer executable instructions include a step of receiving 71 oneor more video images, as described in further detail hereinabove.

In one example, the step includes receiving 71 a live video stream ofimages captured live by one or more cameras during a tennis match, oneor more stills images which capture the empty tennis court before thematch begins and the court, ball and players during the match, etc.

The computer executable instructions further include a step of deriving72 two or more background templates from the received 71 video images.

Optionally, the background templates are derived 72 using one or morecurrent background subtraction methods, as described in further detailhereinabove.

Optionally, each one of at least two of the background templates isderived 72, using a respective and different one of a plurality ofbackground calculation methods.

Optionally, each one of at least two of the background templates isderived 72 using a respective and at least partially different subset ofthe received 71 video images.

For example, each one of at least two of the background templates may bederived 72 using a respective and at least partially less recent subsetof the received 71 video images. Thus, in one example, a first one ofthe background templates is derived 72 from recent twenty of thereceived 71 video images, whereas a second one of the backgroundtemplates is derived 72 from recent thirty of the received 71 videoimages. Consequently, the second background template's thirty imagesinclude ten images which are less recent than the first backgroundtemplate's twenty images. The second background template is thus atleast partially less recent than the first background template.

Optionally, each one of at least two of the background templates isderived 72 using a respective and different frequency of sampling of thereceived 71 video images, be the frequency based on time, on order ofreceipt 71, etc., as described in further detail hereinabove.

Thus, in one example, a first background template is derived 72 from tenof the received 71 images of a received 71 sequence of video images, sayimages streamed from a camera, as described in further detailhereinabove. Each one of the ten images is an image received 71 a coupleof seconds before the next one of the ten images (say with a number ofimages received 71 in between the two images).

In the example, a second background template is also derived 72 from tenof the received 71 video images. However, each one of the ten imageswhich the second background template is derived 72 from, is an imagereceived 71 three seconds before the next one of the ten images (i.e.with a greater number of images received 71 in between the two images).

Similarly, in another example, a first background template is derived 72from twenty of the received 71 video images of a sequence of videoimages, say the images streamed from the camera, as described in furtherdetail hereinabove. In the example, the twenty images include each tenthimage streamed from the camera, thus each one of the twenty images is animage received 71 tenth in the sequence, after an image added earlier tothe twenty images.

In the example, a second background template is also derived 72 fromtwenty of the received 71 video images. However, the twenty imagesinclude each fifth image, thus each one of the twenty images is an imagereceived 71 fifth in the sequence streamed from the camera, after animage added earlier to the twenty images.

Optionally, each one of at least two of the background templates isderived 72 using a respective and different in size subset of thereceived 71 video images, as described in further detail hereinabove.

Thus, in one example, a first one of the background templates is derived72 from twenty of the received 71 video images, whereas a second one ofthe background templates is derived 72 from ten of the received 71 videoimages, as described in further detail hereinabove.

Optionally, the computer executable instructions further includeinstructions of updating each one of at least two of the backgroundtemplates, with a respective and different update rate.

Thus, in one example, a first background template is derived 72 from asubset which consists of twenty of the received 71 video images. Everyten seconds, the first background template is updated by discarding oneimage of earliest receipt 71 among the twenty images, and adding animage received 71 immediately before the updating, to the subset.

Then, the first background template is derived 72 again (i.e.re-calculated), according to the thus updated subset of twenty images.Thus, the first background template is derived 72 dynamically, with anupdate rate of ten seconds.

In the example, a second background template is derived 72 from a subsetwhich also consists of twenty of the received 71 video images. Everyfive seconds, the second background template is updated by discardingone image of earliest receipt 71 among the twenty images, and adding animage received 71 immediately before the updating, to the subset.

Then, the second background template is derived 72 again (i.e.re-calculated), according to the thus updated subset of twenty images.Thus, the second background template is also derived 72 dynamically.However, the second background template is rather derived 72 with anupdate rate of five seconds.

In one example, the computer executable instructions are used as a partof an implementation of a method for locating objects of interest, suchas a ball or a player, during a sport event, and for tracking themovements of the objects of interest, in a three dimensional space whichrepresents a constrained environment, say of a tennis court or afootball field, as described in further detail hereinabove.

In the example, there is needed to extract an object of interest (say atennis ball or a soccer player) from an individual one of the received71 video images, say from the fed stream of video images' most recentimage.

The object of interest is extracted 75 from the individual image, usingtwo or more of the background templates. Each one of the backgroundtemplates is derived 72 from one or more of the images received 71 priorto that individual, most recent image (i.e. some or all of thesequence's earlier images), as described in further detail hereinbelow.

The computer executable instructions further include a step ofcalculating 74 a plurality of differences. Each one of the differencesis calculated 74 between the individual (say current) video image and arespective and different one of the derived 72 background templates.Thus, the derived 72 background template used for calculating 74 eachdifference, is a different one.

The computer executable instructions further include a subsequent stepin which one or more objects of interest is extracted 75 from theindividual video image, using a rule applied on the calculated 74differences, as described in further detail hereinabove.

The rule serves as a basis for comparison, weighting, or any otherpattern of decision making, according to which decision making, theportion of the individual image in which the object of interest iscaptured, is identified, thus extracting 75 the object of interest fromthe individual image.

The rule applied on the calculated 74 differences may be selected by auser, or rather be selected automatically, as described in furtherdetail hereinabove.

In one example, the computer executable instructions further comprise astep of binarizing the calculated 74 differences, using a thresholdvalue, and the rule applied on the differences dictates applying logicalconjunction among the binarized differences, for extracting 75 theobject of interest.

More specifically, in the example, the received 71 video images aregrayscale digital images which belong to a same video stream. Theindividual image is the video stream's most recent image, also referredto hereinbelow as the current image, and each one of the backgroundtemplates is derived 72 from one or more images of the received 71 videostream.

In the example, each pixel in each one of the background templates isderived 72 by averaging over grayscale intensity values of all pixels ofa same position, in a different number of the received 71 video images.

For example, a first background template is derived 72 by averaging overthe intensity values of pixels in a same position in recent twenty ofthe received 71 video images. A second background template is derived 72by averaging over intensity values of pixels in a same position inrecent ten of the received 71 video images. Further, a third backgroundtemplate is derived 72 by averaging over intensity values of pixels in asame position in recent five of the received 71 video images, asdescribed in further detail hereinabove.

In the example, a difference is calculated 74 between the current (i.e.the most recently received 71) image and each one of the threebackground templates, respectively, thus calculating 74 a difference pereach one of the three background templates. The resultant difference isin the form of an image of a same size as of each one of the received 71video images

In the difference, each pixel's grayscale intensity equals thedifference between the current image's grayscale intensity in that pixel(i.e. in the same position) and the average intensity for that pixel'sposition, as indicated in the background template (say the grayscaleintensity of the background template in that pixel position).

Optionally, for binarizing the difference, each one of the difference'spixels is compared to a threshold. The threshold's value may be setmanually or rather be determined automatically, say according to a rulebased on user input or automatically set parameters, such as weatherconditions (say cloudy vs. sunny), an average speed of the object ofinterest (say a ball), a time of day, etc.

In one example, if the grayscale intensity value of the difference'spixel exceeds the threshold value, the pixel's grayscale intensity isset to a value representing a binary ‘1’, say to maximum. Otherwise, thepixel's grayscale intensity is set to a value representing a binary ‘0’,say to minimum.

Then, in accordance with a rule used in the instant example, a logicalconjunction is applied among the three binarized differences, forextracting 75 the object of interest. Each pixel set to a binary ‘1’ inall three differences, is deemed to mark a respective current image'spixel position occupied by the object of interest, and the remainingpixels are deemed to mark positions of the current image's background,as described in further detail hereinabove.

That is to say that in the instant example, a logical conjunction of thebinarized differences results in a binary (say black and white) imagewhich maps the current image's area which is occupied by the object ofinterest.

Optionally, the computer executable instructions further include a stepof allowing a user to select the rule applied on the calculated 74differences among two or more rules predefined by a user, administrator,or developer, or rather to select a rule by inputting the rule himself,say using natural language , in a GUI, etc., as described in furtherdetail hereinabove.

Optionally, the rule applied on the calculated 74 differences isautomatically selected among two or more alternative rules predefined bya user, administrator, or developer. For example, the rule may beselected according to user input or automatically set parameters, suchas weather conditions (say cloudy vs. sunny), an average speed of theobject of interest (say a ball), a time of day, etc., as described infurther detail hereinabove.

Optionally, the computer executable instructions further include a stepof automatically selecting the rule applied on the calculated 74differences, among the two or more predefined rules, according tocircumstances of capturing of the received 71 video images. Thecircumstances may include, for example, a type of a sport event capturedin the video images (say Tennis vs. Golf), weather conditions (saycloudy vs. sunny), time of day (say evening vs. morning), etc., or anycombination thereof.

Thus, in one example, when an optical sensor, or a user input data,indicates a sunny weather, the applied rule may give less (or even zero)weight to calculated 74 differences based on background templatesderived 72 from a small subset of the received 71 video images. Forexample, the rule may dictate relying only on the above example'sdifference based on the background template derived from the recenttwenty of the received 71 video images while discarding the backgroundtemplates derived 72 from ten and five first ones of the received 71video images.

In another example, when the optical sensor or user input data indicatesa partially cloudy weather, the applied rule may give a same weight todifferences based on background templates derived 72 from subsets ofdifferent sizes, say by relying on a logical conjunction applied on theabove example's three differences.

In yet another example, when the optical sensor indicates a cloudyweather, the applied rule may be based on only two of the aboveexample's differences, say on a logical conjunction applied only on theabove example's two differences which are based on the backgroundtemplates derived from the ten and five received 71 video images.

Optionally, the computer executable instructions further include a stepof automatically selecting the rule applied on the calculated 74differences, among the two or more predefined rules, according to acharacteristic which pertains to the object of interest. For example,the rule applied on the calculated 74 differences may be automaticallyselected according to a size or an average speed of the object ofinterest (say a ball or player), as measured during the tennis match (orduring previously played tennis matches), or as input by a user, asdescribed in further detail hereinabove.

Thus, in one example, with a different size or average speed of theobject of interest, a different one or two of the above made example'sthree calculated 74 differences, may be used, to extract 75 the objectof interest, say using a Boolean or other rule applied on the one or twodifferences, as described in further detail hereinabove.

Optionally, the computer executable instructions further include a stepof automatically selecting the rule applied on the calculated 74differences, among the two or more predefined rules, according to acharacteristic which pertains to the background, say the background'sbeing more static (say a fence or gate) as apposed to the background'sbeing less static (say an audience of sport fans).

Optionally, the computer executable instructions further include a stepof determining that the background is more static or less static, basedon data input by a user, based on processing of audio input whichoriginates from the audience areas, etc.

Thus, in one example, with a background which is less static, one of thecalculated 74 differences may be used, to extract 75 the object ofinterest, whereas with a background which is more static, another one ofthe calculated 74 differences may be used, to extract 75 the object ofinterest.

Optionally, the deriving 72 of the background templates is based a ruleselected among two or more of predefined rules.

Optionally, the computer executable instructions further include a stepof allowing a user to select the rule used for the deriving 72 thebackground templates, among two or more rules predefined by a user,administrator, or developer, or rather to select the rule by inputtingthe rule himself, say using natural language and a GUI, as described infurther detail hereinabove.

Optionally, the computer executable instructions further include a stepof automatically selecting the rule used for the deriving 72 thebackground templates, among two or more rules predefined by a user,administrator, or developer. For example, the rule may be selectedaccording to user input or automatically set parameters, such as weatherconditions (say cloudy vs. sunny), an average speed of the object ofinterest (say a ball), a time of day, etc.

Optionally, the computer executable instructions further include a stepof automatically selecting the rule used for the deriving 72 thebackground templates, among the two or more predefined rules, accordingto circumstances of capturing of the received 71 video images. Thecircumstances may include, for example, a type of a sport event capturedin the video images (say Tennis vs. Golf), weather conditions (saycloudy vs. sunny), time of day (say evening vs. morning), etc., or anycombination thereof.

For example, the rule may dictate the derivation 72 of differentbackground templates upon different types of sport events captured inthe received 71 video images (say Tennis vs. Golf), different weatherconditions (say cloudy vs. sunny), different times of day (say eveningvs. morning), etc., or any combination thereof.

Thus, in one example, when an optical sensor, or a user input data,indicates a sunny weather, there may be derived 72 only a backgroundtemplate based on recent twenty of the received 71 video images and abackground template based on recent ten of the received 71 video images,whereas in a more cloudy weather, there may be additionally derived 72 abackground template based on recent five of the received 71 videoimages.

Optionally, the computer executable instructions further include a stepof automatically selecting the rule used for deriving 72 the backgroundtemplates, among the two or more predefined rules, according to acharacteristic which pertains to the object of interest, say a size oran average speed of the ball or player, as measured during the tennismatch (or during previously played tennis matches), or as input by auser or administrator, as described in further detail hereinabove.

Thus, in one example, with a different size or average speed of theobject of interest, a different one or two of the above made example'sthree background templates may be calculated.

Optionally, the computer executable instructions further include a stepof automatically selecting the rule used for deriving 72 the backgroundtemplates, among the two or more predefined rules, according to acharacteristic which pertains to the background, say the background'sbeing more static (say a fence or gate) as apposed to the background'sbeing less static (say an audience of sport fans).

Optionally, the computer executable instructions further includedetermining that the background is more static or less static based ondata input by a user, based on processing of audio input originatingfrom the audience areas, etc., as described in further detailhereinabove.

Thus, in one example, with a different size or average speed of theobject of interest, a different one or two of the above made example'sthree background templates may be derived 72.

It is expected that during the life of this patent many relevant devicesand systems will be developed and the scope of the terms herein,particularly of the terms “Computer”, “Camera”, “Video”, “Image”,“CD-ROM”, a “USB-Memory”, a “Hard Disk Drive (HDD)”, and “Solid StateDrive (SSD)”, is intended to include all such new technologies a priori.

It is appreciated that certain features of the invention, which are, forclarity, described in the context of separate embodiments, may also beprovided in combination in a single embodiment. Conversely, variousfeatures of the invention, which are, for brevity, described in thecontext of a single embodiment, may also be provided separately or inany suitable sub-combination.

Although the invention has been described in conjunction with specificembodiments thereof, it is evident that many alternatives, modificationsand variations will be apparent to those skilled in the art.Accordingly, it is intended to embrace all such alternatives,modifications and variations that fall within the spirit and broad scopeof the appended claims.

All publications, patents and patent applications mentioned in thisspecification are herein incorporated in their entirety by referenceinto the specification, to the same extent as if each individualpublication, patent or patent application was specifically andindividually indicated to be incorporated herein by reference. Inaddition, citation or identification of any reference in thisapplication shall not be construed as an admission that such referenceis available as prior art to the present invention.

What is claimed is:
 1. A computer implemented method of objectextraction from images, the method comprising steps a computer isprogrammed to perform, the steps comprising: receiving a plurality ofbackground templates and at least one image; calculating a plurality ofdifferences for an individual one of the received at least one image,each one of the differences being calculated between the individualimage and a respective one of the received background templates; andextracting an object of interest from the individual image, using a ruleapplied on the calculated differences.
 2. The method of claim 1, furthercomprising selecting the rule among a plurality of predefined rules. 3.The method of claim 1, further comprising allowing a user to define therule.
 4. The method of claim 1, further comprising selecting the ruleaccording to circumstances of capturing of the received at least oneimage.
 5. The method of claim 1, further comprising selecting the ruleaccording to a characteristic pertaining to the object of interest. 6.The method of claim 1, further comprising selecting the rule accordingto a characteristic pertaining to a background of the received at leastone image.
 7. The method of claim 1, wherein each one of at least two ofthe received background templates is a template derived using arespective and different one of a plurality of background calculationmethods.
 8. The method of claim 1, wherein each one of at least two ofthe received background templates is a template derived using arespective and at least partially different subset of the received atleast one image.
 9. The method of claim 1, wherein each one of at leasttwo of the received background templates is a template derived using arespective and at least partially less recent subset of the received atleast one image.
 10. The method of claim 1, wherein each one of at leasttwo of the received background templates is a template derived using arespective and different frequency of sampling of the received at leastone image.
 11. The method of claim 1, wherein each one of at least twoof the received background templates is a template derived using arespective and different in size subset of the received at least oneimage.
 12. The method of claim 1, further comprising updating each oneof at least two of the received background templates, with a respectiveand different update rate.
 13. Apparatus for object extraction fromimages, the apparatus comprising: a computer; a difference calculator,configured to receive a plurality of background templates and at leastone image and calculate a plurality of differences for an individual oneof the received at least one image, each one of the differences beingcalculated between the individual image and a respective one of thereceived background templates; and an object extractor, in communicationwith said difference calculator, configured to extract an object ofinterest from the individual image, using a rule applied on thecalculated differences.
 14. A non-transitory computer readable mediumstoring computer executable instructions for performing steps of objectextraction from images, the steps comprising: receiving a plurality ofbackground templates and at least one image; calculating a plurality ofdifferences for an individual one of the received at least one image,each one of the differences being calculated between the individualimage and a respective one of the received background templates; andextracting an object of interest from the individual image, using a ruleapplied on the calculated differences.